//Week2 ICM Make it move!
var value = "0";
var a = 10;


function setup() { 
  createCanvas(500, 500); 
} 


function draw() {
  background(255);
  
  
  
  //code
  fill(212);
  textSize(20);
  text("var{stroke(123,123,321){stroke(123,123,321)fill(255,255,255)set;}{stroke(123,123,321(123,123,321)fill(255,255,255)set;{stroke(123,123,321)}var{stroke(123,123,321){stroke(123,123,321)fill(255,255,255)set;}{stroke(123,123,321)ITPIsAwesomeWeLoveCodingtrainar{stroke(123,123,321){stroke(123,123,321)fill(255,255,255)set;{stroke(123,123,321)}",0+a,0,150,120); 
  text("text{stroke()Codingsohardfill()setvar=1{(200,123,48,);}ar{stroke(123,123,321)fill(255,255}ar{stroke(123,123,321)fill(255,255,255)set;};noStroke();fill(247,221,212)ITPIsAwesomeWeLoveCodingtrainar{stroke(123,123,321)", 5+a,25,150,120);
  text("(123,123,321)fill(255,255,255)set;}ITPIsAwesomeWeLoveCodingtrainarc(250,245,270,420,ke(123,123,321)fill(255,255}ar{stroke(123,123,321)fill(255,255,255)set;}TPIsAwesomeWeLoveCodingtrainar{stroke(123,123,321)",0+a,50,150,120); 
  text("noStroke();fill(247,221,212);ellipse(250,200,190,200);21,212);noStroke();fill(247,221,212);ellipse(250,200,190,200);ellipse(250,200,190,200)",0+a,75,150,120); 
  text("triangle(250, 220, 260, 250, 240, 250)}{)setvar=1{(200,123,48,);noStroke();fill(247,221,212);ellipse(250,200,190,200);}ar{s",0+a,100,150,120);
  text("fill(255,255,255)set;var{stroke(12fill(255,255,255)set;}ITPIsAwesome)setvar=1{(200,123,48,;noStroke();(123,123,321)fillnoStroke();fill(247,221,212))",0+a,150,150,120);
  text("noStroke();fill(247,221,212);ellipse(250,200,190,200);noStroke();fill(247,221,212);ellipse(250,200,190,200);",0+a,175,150,120); 
  text("text{stroke()Codingsohardfill()setvar=1{(200,123,48,);}ar{stroke(123,123,321)fill(255,255,255)set;}", 5+a,200,150,120);
  text("text{stroke()Codingsohardfill()setvar=1{(200,123,48,);}ar{stroke(123,123,321)fill(255,255}ar{stroke(123,123);fill(247,221,212)", 5+a,225,150,120);
  text("(123,123,321)fill(255,255,255)set;}ITPIsAwesomeWeLoveCodingtrainarc(250,245,270,420,ke(123,123,321)fill(255,255}ar{stroke(123,123,321)fill(255,255,255)set;}",0+a,250,150,120); 
  text("noStroke();fill(247,221,212);ellipse(250,200,190,200);21,212);noStroke();fill(247,221,212);ellipse(250,200,190,200);ellipse(250,200,190,200)",0+a,275,150,120); 
  text("triangle(250, 220, 260, 250, 240, 250)}{)setvar=1{(200,123,48,);noStroke();fill(247,221,212);ellipse(250,200,190,200);}ar{s",0+a,300,150,120);
  text("fill(255,255,255)set;var{stroke(12fill(255,255,255)set;}ITPIsAwesome)setvar=1{(200,123,48,;noStroke();(123,123,321)fill(255,255,255)set;};noStroke()fill(247,221,212);noStroke();fill(247,221,212))",0+a,350,150,120);
  text("noStroke();fill(247,221,212);ellipse(250,200,190,200);noStroke();fill(247,221,212);ellipse(250,200,190,200);noStroke();fill(247,221,212);ellipse(250,200,190,200);",0+a,400,150,120); 
  text("text{stroke()Codingsohardfill()setvar=1{(200,123,48,);}ar{stroke(123,123,321)fill(255,255,255)set;}", 5+a,425,150,120);  
  a=a+4
  if(a>0){
    a=-500
  }
  


  if (value == "0") {
  
  //hair
    noStroke()
    fill(64,51,38);
    arc(250,245,270,420, QUARTER_PI+HALF_PI,QUARTER_PI);
  
  //ear
    fill(247,221,212);
    ellipse(163,215,50,50);
  
  //face
    noStroke();
    fill(247,221,212);
    ellipse(250,200,190,200);
  
  //check
    noStroke();
    fill(255, 184, 194);
    ellipse(200,230,30,20);
    ellipse(300,230,30,20);
  
  //bang
    noStroke();
    fill(64,51,38);
    arc(250,130,160,80, Math.PI, 0);
    arc(300,100,270,125, 0.25*Math.PI, Math.PI);
  
  //eyebrows
    stroke(64,51,38);
    strokeWeight(6);
    line(190,173,220,170);
    line(278,170,308,173);
  
  //eyes
    stroke(128, 128, 128);
    strokeWeight(1);
    fill(255);
    ellipse(209, 200, 35, 35);
    ellipse(291, 200, 35, 35);
 
  //eyeballs
    stroke(128, 128, 128);
    fill(102,102,51);
    ellipse(209, 200, 18, 18);
    ellipse(291, 200, 18, 18);
  
  //NOSE
    noStroke();
    fill(247,221,155);
    triangle(250, 220, 260, 250, 240, 250);

  //MOUTH
    noStroke();
    fill(255, 169, 168);
    ellipse(250,270,12,12);
  
  //shoulders
    noStroke();
    fill(247,221,212);
    rect(165,315,170,132,18);  
 
  //TSHIRT
    noStroke();
    fill(102,21,173);
    rect(190,310,120,140,8);  
  
  //neck
    noStroke();
    fill(247,221,212);
    arc(250,310,40,40,0,PI);
    rect(230,280,40,30);

   
    
} else if (value == "1") {
  
  
  //hair
    noStroke()
    fill(64,51,38);
    arc(250,245,270,420, QUARTER_PI+HALF_PI,QUARTER_PI);
  
  //ear
    fill(247,221,212);
    ellipse(163,215,50,50);
  
  //face
    noStroke();
    fill(247,221,212);
    ellipse(250,200,190,200);
  
  //check
    frameRate(15);
    noStroke();
    fill(255,random(164,171),random(196,212));
    ellipse(random(197,203),random(228,232),30,20);
    ellipse(random(297,303),random(228,232),30,20);
  
  //bang
    noStroke();
    fill(64,51,38);
    arc(250,130,160,80, Math.PI, 0);
    arc(300,100,270,125, 0.25*Math.PI, Math.PI); 
  
  //eyebrows
    frameRate(10);
    stroke(64,51,38);
    strokeWeight(random(5,7));
    line(190,random(171,175),220,random(168,171));
    line(278,random(168,172),308,random(171,175));
  
  //eyes
    stroke(128, 128, 128);
    strokeWeight(1);
    fill(255);
    ellipse(209, 200, 35, 35);
    ellipse(291, 200, 35, 35);
 
  //eyeballs
    frameRate(10);
    stroke(128, 128, 128);
    fill(102,102,51);
    ellipse(random(201,217), random(194,206), 18, 18);
    ellipse(random(281,300), random(194,206), 18, 18);
  
  //NOSE
    noStroke();
    fill(247,221,155);
    triangle(250, 220, 260, 250, 240, 250);

  //ewwww!
    
  
  //MOUTH
    frameRate(10);
    noStroke();
    fill(255, 169, 168);
    ellipse(250,270,random(10,20),12);
  
  //shoulders
    noStroke();
    fill(247,221,212);
    rect(165,315,170,132,18);
 
  //TSHIRT
    noStroke();
    fill(102,21,173);
    rect(190,310,120,140,8);
  
  //neck
    noStroke();
    fill(247,221,212);
    arc(250,310,40,40,0,PI);
    rect(230,280,40,30);
  }
  
  drawITP()
}  

function mousePressed() {
  if (value == "0") {
    value = "1";
  } else {
    value ="0";
  }
   noLoop()
}
function mouseReleased() {
  loop()
}
  
function drawITP()
{
      //ITP
    textSize(32)
    fill(random(255), random(255), random(255)); 
    text("!TP",225,350,150,120); 
    textSize(36) 
  }




